
LDFLAGS := -lpthread
TARGERTS := $(subst .c,,$(wildcard *.c))


thread1: thread1.c
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
thread2: thread2.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
thread3: thread3.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
thread4: thread4.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
mutex: mutex.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
semaphore: semaphore.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
chat_clnt: chat_clnt.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
chat_server: chat_server.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
chat_clnt: chat_clnt.c 
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)




all: ${TARGERTS}


clean: 
	-rm *.o ${TARGERTS}

.PHONY: all clean 